PUTC

Section: C Library Functions (3)
Index Return to Main Contents

BSD mandoc
 

NAME

fputc putc putchar putw - output a character or word to a stream  

SYNOPSIS

Fd #include <stdio.h> Ft int Fn fputc int c FILE *stream Ft int Fn putc int c FILE *stream Ft int Fn putchar int c Ft int Fn putw int w FILE *stream  

DESCRIPTION

The Fn fputc function writes the character Fa c (converted to an ``unsigned char'') to the output stream pointed to by Fa stream .

Fn Putc acts essentially identically to Fn fputc , but is a macro that expands in-line. It may evaluate Fa stream more than once, so arguments given to Fn putc should not be expressions with potential side effects.

Fn Putchar is identical to Fn putc with an output stream of stdout

The Fn putw function writes the specified int to the named output Fa stream .  

RETURN VALUES

The functions, Fn fputc , Fn putc and Fn putchar return the character written. If an error occurs, the value EOF is returned. The Fn putw function returns 0 on success; EOF is returned if a write error occurs, or if an attempt is made to write a read-only stream.  

SEE ALSO

ferror(3), fopen(3), getc(3), stdio(3)  

STANDARDS

The functions Fn fputc , Fn putc , and Fn putchar , conform to St -ansiC . A function Fn putw function appeared in AT&T System v6 .  

BUGS

The size and byte order of an int varies from one machine to another, and Fn putw is not recommended for portable applications.


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
SEE ALSO
STANDARDS
BUGS

This document was created by man2html, using the manual pages.
Time: 16:28:57 GMT, April 18, 2022